﻿using mvcForum.Core.Interfaces.AddOns;
using mvcForum.Core.Interfaces.Data;
using System;

namespace mvcForum.Core.Abstractions {

	public abstract class AsyncAddOnConfiguration<TAddOn> : AddOnConfiguration<TAddOn> where TAddOn : IAddOn {

		private static class Keys {
			public const String RunAsynchronously = "RunAsynchronously";
			public const String Delay = "Delay";
		}

		protected AsyncAddOnConfiguration(IRepository<AddOnConfiguration> configRepo) : base(configRepo) { }

		public Boolean RunAsynchronously {
			get {
				return this.GetBoolean(Keys.RunAsynchronously);
			}
			set {
				this.Set(Keys.RunAsynchronously, value);
			}
		}

		public Int32 Delay {
			get {
				return this.GetInt32(Keys.Delay);
			}
			set {
				this.Set(Keys.Delay, value);
			}
		}
	}
}